package com.caius.xiaohashu.user.biz.rcp;

import com.caius.framework.common.response.Response;
import com.caius.xiaohashu.oss.api.FileFeignApi;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author Caius
 * @description 转换调用
 * @since Created in 2025-05-18
 */
@Component
public class RcpOssService {

    @Resource
    private FileFeignApi fileFeignApi;

    public String uploadFile(MultipartFile file) {
        Response<?> response = fileFeignApi.uploadFile(file);

        if (!response.isSuccess()) {
            return null;
        }

        return (String) response.getData();
    }
}
